const ua = navigator.userAgent

export const isIOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(ua)

export const isAndroid = /(android)|(Android)|(Adr)/i.test(ua)

export const isWechat = /MicroMessenger/i.test(ua)

export const isAlipay = /AlipayClient/i.test(ua)

export const isWechatMini = /(?=[\W\w]*MicroMessenger)(?=[\W\w]*MiniProgram)/i.test(ua)

export const isAlipayMini = /(?=[\W\w]*AlipayClient)(?=[\W\w]*MiniProgram)/i.test(ua)

export const isDingTalk = /DingTalk/i.test(ua)

export const isHsbApp = /defineInhsbApp/i.test(ua)

export const isHsbZybApp = /isHsbZybApp/i.test(ua)

export const isHuaweiApp = /VMall-APK/i.test(ua)

export const isHonorApp = /HihonorStore-APK/i.test(ua)

export const isLenovoApp = /lenovoofficialapp/i.test(ua)

export const isVivoApp = /VivoSpace/i.test(ua)

export const isVivoIOSApp = isVivoApp && /iPhone OS/i.test(ua)